package com.sxb.friday.base.result;

import lombok.Data;

import java.io.Serializable;

@Data
public class PageTableRequest implements Serializable {

    // 当前页 1，2，3，...
    private Integer page;
    // 页大小 10,20,30,...
    private Integer limit;
    // mysql偏移量
    private Integer offset;

    public void countOffset(){
        if(null == this.page || null == this.limit){
            this.offset = 0;
            return;
        }
        this.offset = (this.page - 1) * limit;
    }

}
